using System;
using NHibernate.Criterion;

namespace FwkLight.Domain.Fetching
{
  public class FetchingFilterNotEq: FetchingFilter
  {
    public FetchingFilterNotEq(string propertyName, object value, IFetchingPart parent) : base(propertyName, value, parent)
    {
    }

    public override void ApplyFilterOn(DetachedCriteria criteria)
    {
      criteria.Add(Restrictions.Not(Restrictions.Eq(Parent.Alias + "." + PropertyName, Value)));
    }
  }
}